home *** CD-ROM | disk | FTP | other *** search
/ Great Canadian Scientists / GCS_CD.iso / mac / PC / GCSData / databa_o.dxr / 00046_Main Scripts.ls < prev    next >
Encoding:
Text File  |  1996-09-21  |  7.4 KB  |  331 lines

  1. on startMovie
  2.   global ScientistTotal, DataBaseEnter, QuizUp, NoQuiz, MovieIdentifier, Screen, NewFind
  3.   cursor(4)
  4.   set NewFind to 1
  5.   HideScore()
  6.   cursor(4)
  7.   HideInfo()
  8.   cursor(4)
  9.   HideDBCopy()
  10.   cursor(4)
  11.   DatabaseScore()
  12.   cursor(4)
  13.   DatabaseInfo()
  14.   cursor(4)
  15.   DBCopyPrep()
  16.   cursor(4)
  17.   ClearTrackScripts()
  18.   cursor(4)
  19.   set ScientistTotal to 146
  20.   BSetup(32, 39)
  21.   BSuspend(4, 4)
  22.   SoundControl()
  23.   cursor(4)
  24.   if DataBaseEnter = 0 then
  25.     go("MainHelp")
  26.     set the mouseUpScript to "LeaveMainHelp"
  27.     set DataBaseEnter to 1
  28.   end if
  29.   cursor(4)
  30. end
  31.  
  32. on ScientistChangeKey
  33.   if charToNum(the key) = 28 then
  34.     PrevScientist()
  35.   end if
  36.   if charToNum(the key) = 29 then
  37.     NextScientist()
  38.   end if
  39. end
  40.  
  41. on IndexChangeKey
  42.   if charToNum(the key) = 28 then
  43.     PrevIndex()
  44.   end if
  45.   if charToNum(the key) = 29 then
  46.     NextIndex()
  47.   end if
  48. end
  49.  
  50. on Index
  51.   global Index
  52.   cursor(4)
  53.   repeat with count = 20 to 23
  54.     set the puppet of sprite count to 0
  55.   end repeat
  56.   BSuspend(4, 4)
  57.   BSuspend(8, 10)
  58.   BSuspend(13, 13)
  59.   set the castNum of sprite 32 to the number of member "Main.flat"
  60.   set the castNum of sprite 33 to the number of member "Find.flat"
  61.   set Index to "Main Screen"
  62.   go("Main Screen")
  63.   cursor(-1)
  64. end
  65.  
  66. on NextScientist
  67.   global ScientistTotal, ScientistNumber
  68.   repeat with count = 20 to 23
  69.     set the puppet of sprite count to 0
  70.   end repeat
  71.   set TempNum to ScientistNumber
  72.   if the frame = (ScientistTotal + 60) then
  73.     go(61)
  74.   else
  75.     go(the frame + 1)
  76.   end if
  77.   put EMPTY before line 1 of field (300 + TempNum)
  78.   BSuspend(4, 4)
  79. end
  80.  
  81. on PrevScientist
  82.   global ScientistTotal, ScientistNumber
  83.   repeat with count = 20 to 23
  84.     set the puppet of sprite count to 0
  85.   end repeat
  86.   set TempNum to ScientistNumber
  87.   if the frame = 61 then
  88.     go(ScientistTotal + 60)
  89.   else
  90.     go(the frame - 1)
  91.   end if
  92.   put EMPTY before line 1 of field (300 + TempNum)
  93.   BSuspend(4, 4)
  94. end
  95.  
  96. on NextIndex
  97.   global IndexTotal, IndexNumber
  98.   if value(IndexNumber) = value(IndexTotal) then
  99.     go(the frame - value(IndexTotal) + 1)
  100.     set IndexNumber to 1
  101.   else
  102.     go(the frame + 1)
  103.     set IndexNumber to value(IndexNumber) + 1
  104.   end if
  105. end
  106.  
  107. on PrevIndex
  108.   global IndexTotal, IndexNumber
  109.   if value(IndexNumber) = 1 then
  110.     go(the frame + value(IndexTotal) - 1)
  111.     set IndexNumber to IndexTotal
  112.   else
  113.     go(the frame - 1)
  114.     set IndexNumber to value(IndexNumber) - 1
  115.   end if
  116. end
  117.  
  118. on idle
  119.   global ButtonsActive, Section
  120.   if ButtonsActive = 1 then
  121.     CheckHilite(32, 39)
  122.   end if
  123.   CheckHilite(42, 43)
  124.   CheckHilite(48, 48)
  125.   SoundLoop()
  126.   if Section <> "Find" then
  127.     PopIdle()
  128.   end if
  129. end
  130.  
  131. on ExitMain
  132.   set the castNum of sprite 32 to the number of member "BackDB.flat"
  133.   BSuspend(8, 10)
  134.   BSuspend(4, 4)
  135.   repeat with count = 10 to 25
  136.     set the puppet of sprite count to 0
  137.   end repeat
  138. end
  139.  
  140. on Find
  141.   global Update, NewFind, OldLineNum, ManBold
  142.   cursor(4)
  143.   ExitMain()
  144.   BHide(32, 32)
  145.   if NewFind = 1 then
  146.     set OldLineNum to 0
  147.     set Update to 1
  148.     set ManBold to 0
  149.     set the hilite of cast "A-L" to 1
  150.     set the hilite of cast "M-Z" to 0
  151.     PrepFind()
  152.     ResetFind()
  153.     set NewFind to 0
  154.   end if
  155.   set the castNum of sprite 33 to the number of member "BackDB.flat"
  156.   if Update = 1 then
  157.     set the hilite of member "Yes" to 1
  158.     set the hilite of member "No" to 0
  159.   else
  160.     set the hilite of member "Yes" to 0
  161.     set the hilite of member "No" to 1
  162.   end if
  163.   set the keyUpScript to "FindUpdate"
  164.   set the keyDownScript to "FindEnterWord"
  165.   go("Find")
  166. end
  167.  
  168. on ExitFind
  169.   set the keyUpScript to EMPTY
  170.   set the castNum of sprite 32 to the number of member "BackDB.flat"
  171.   set the castNum of sprite 33 to the number of member "Find.flat"
  172.   BSuspend(21, 22)
  173. end
  174.  
  175. on ResetFind
  176.   resetField(the number of member "Results", 12, "Plain", "Helvetica")
  177.   set the textStyle of field "Words1" to "Plain"
  178.   set the textStyle of field "Words2" to "Plain"
  179.   set the scrollTop of member "Words1" to 0
  180.   set the scrollTop of member "Words2" to 0
  181.   resetField(the number of member "Entry", 12, "Plain", "Helvetica")
  182. end
  183.  
  184. on IndexHilite
  185.   global ButtonsActive
  186.   if ButtonsActive = 0 then
  187.     exit
  188.   end if
  189.   CheckHilite(11, 15)
  190.   CheckHilite(21, 25)
  191.   set MapHilite to 0
  192.   repeat with count = 26 to 30
  193.     if rollOver(count) = 1 then
  194.       set MapHilite to 1
  195.     end if
  196.   end repeat
  197.   if MapHilite = 1 then
  198.     if (the castNum of sprite 10 mod 3) = 1 then
  199.       set the castNum of sprite 10 to the castNum of sprite 10 + 1
  200.     end if
  201.     if the stillDown = 1 then
  202.       if (the castNum of sprite 10 mod 3) = 2 then
  203.         set the castNum of sprite 10 to the castNum of sprite 10 + 1
  204.       end if
  205.     else
  206.       if (the castNum of sprite 10 mod 3) = 0 then
  207.         set the castNum of sprite 10 to the castNum of sprite 10 - 1
  208.       end if
  209.     end if
  210.   else
  211.     if (the castNum of sprite 10 mod 3) = 2 then
  212.       set the castNum of sprite 10 to the castNum of sprite 10 - 1
  213.     end if
  214.     if (the castNum of sprite 10 mod 3) = 0 then
  215.       set the castNum of sprite 10 to the castNum of sprite 10 - 2
  216.     end if
  217.   end if
  218.   repeat with loop = 26 to 30
  219.     set count to loop - 10
  220.     if rollOver(loop) = 1 then
  221.       if (the castNum of sprite count mod 3) = 1 then
  222.         set the castNum of sprite count to the castNum of sprite count + 1
  223.       end if
  224.       if the stillDown = 1 then
  225.         if (the castNum of sprite count mod 3) = 2 then
  226.           set the castNum of sprite count to the castNum of sprite count + 1
  227.         end if
  228.       else
  229.         if (the castNum of sprite count mod 3) = 0 then
  230.           set the castNum of sprite count to the castNum of sprite count - 1
  231.         end if
  232.       end if
  233.       next repeat
  234.     end if
  235.     if (the castNum of sprite count mod 3) = 2 then
  236.       set the castNum of sprite count to the castNum of sprite count - 1
  237.     end if
  238.     if (the castNum of sprite count mod 3) = 0 then
  239.       set the castNum of sprite count to the castNum of sprite count - 2
  240.     end if
  241.   end repeat
  242. end
  243.  
  244. on Back
  245.   global Index, Section, ReturnPlace
  246.   if the frame < 60 then
  247.     if Section = "Find" then
  248.       BShow(32, 33)
  249.       ExitFind()
  250.       if (Index = "Main Screen") or (Index = EMPTY) then
  251.         Index()
  252.       else
  253.         go(ReturnPlace)
  254.       end if
  255.     else
  256.       Index()
  257.     end if
  258.   else
  259.     cursor(4)
  260.     repeat with count = 20 to 23
  261.       set the puppet of sprite count to 0
  262.     end repeat
  263.     BSuspend(4, 4)
  264.     BSuspend(8, 10)
  265.     BSuspend(13, 13)
  266.     BShow(32, 33)
  267.     set the castNum of sprite 32 to the number of member "BackDB.flat"
  268.     set the castNum of sprite 33 to the number of member "Find.flat"
  269.     cursor(-1)
  270.     if (Index = "Main Screen") or (Index = EMPTY) then
  271.       Index()
  272.     else
  273.       go(Index)
  274.     end if
  275.   end if
  276. end
  277.  
  278. on Help
  279.   if the frame < 5 then
  280.     go("MainHelp")
  281.   else
  282.     if the frame < 55 then
  283.       BSetup(2, 3)
  284.       BSetup(8, 9)
  285.       go("IndexHelp")
  286.     else
  287.       if the frame < 60 then
  288.         beep()
  289.       else
  290.         beep()
  291.       end if
  292.     end if
  293.   end if
  294. end
  295.  
  296. on LeaveMainHelp
  297.   cursor(4)
  298.   ClearTrackScripts()
  299.   puppetTempo(120)
  300.   go("Main Screen")
  301.   cursor(-1)
  302. end
  303.  
  304. on LeaveIndexHelp
  305.   ClearTrackScripts()
  306.   BSuspend(2, 3)
  307.   puppetTempo(120)
  308.   Back()
  309. end
  310.  
  311. on stopMovie
  312.   put "   " into field "Index"
  313.   set the soundEnabled to 1
  314.   sound stop 2
  315. end
  316.  
  317. on EnterIndex Num
  318.   global Index, Section, DataBaseEnter, IndexTotal, IndexNumber
  319.   set IndexNumber to 1
  320.   set IndexTotal to Num
  321.   put Index into field "Index"
  322.   set Section to Index
  323.   set the keyDownScript to "IndexChangeKey"
  324.   if DataBaseEnter < 2 then
  325.     BSetup(2, 3)
  326.     BSetup(8, 9)
  327.     go("IndexHelp")
  328.     set DataBaseEnter to 2
  329.   end if
  330. end
  331.